<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>快车租车 - 添加车辆</title>
    <link rel="icon" href="../img/logo.png">
    <link rel="stylesheet" href="../css/add-vehicle.css">
    <!-- 添加认证相关脚本 -->
    <script src="../js/authTokenManager.js"></script>
    <script src="../utils/cookieUtils.js"></script>
    <script src="../utils/api.js"></script>
    <script src="../api/auth.js"></script>
</head>
<body>
<div class="head-container">
    <div class="logo-section">
        <img src="../img/logo.png" alt="快车租车" class="logo-img" onclick="window.location.href='../index.html'" style="cursor: pointer;">
        <div class="logo-text">快车租车</div>
    </div>
    <div class="user-actions-container">
        <!-- 用户信息显示区域 -->
        <div class="user-section" id="userSection"></div>
        <button class="logout-btn">退出账号</button>
    </div>
</div>
    
<div class="main-container">
    <div class="form-title">
        <h2>添加车辆信息</h2>
        <p>请填写您要出租的车辆详细信息</p>
    </div>
    
    <form id="addVehicleForm" class="vehicle-form">
        <!-- 基本信息部分 -->
        <div class="form-section">
            <h3>基本信息</h3>
            <div class="form-row">
                <div class="form-group">
                    <label for="brand">品牌 <span class="required">*</span></label>
                    <input type="text" id="brand" name="brand" placeholder="如：丰田、特斯拉" required>
                </div>
                <div class="form-group">
                    <label for="model">车型 <span class="required">*</span></label>
                    <input type="text" id="model" name="model" placeholder="如：凯美瑞、Model3" required>
                </div>
            </div>
            
            <div class="form-row">
                <div class="form-group">
                    <label for="color">颜色 <span class="required">*</span></label>
                    <input type="text" id="color" name="color" placeholder="如：白色、黑色" required>
                </div>
                <div class="form-group">
                    <label for="license_plate">车牌号 <span class="required">*</span></label>
                    <input type="text" id="license_plate" name="license_plate" placeholder="如：京A12345" required>
                </div>
            </div>
        </div>
        
        <!-- 车辆参数部分 -->
        <div class="form-section">
            <h3>车辆参数</h3>
            <div class="form-row">
                <div class="form-group">
                    <label for="seat_count">座位数量 <span class="required">*</span></label>
                    <input type="number" id="seat_count" name="seat_count" min="1" max="10" placeholder="请输入座位数量" required>
                </div>
                <div class="form-group">
                    <label for="power_type">动力类型 <span class="required">*</span></label>
                    <select id="power_type" name="power_type" required>
                        <option value="">请选择动力类型</option>
                        <option value="汽油">汽油</option>
                        <option value="柴油">柴油</option>
                        <option value="电动">电动</option>
                        <option value="油电混动">油电混动</option>
                    </select>
                </div>
            </div>
            
            <div class="form-row">
                <div class="form-group">
                    <label for="mileage">里程数(公里) <span class="required">*</span></label>
                    <input type="number" id="mileage" name="mileage" min="0" placeholder="请输入里程数" required>
                </div>
            </div>
        </div>
        
        <!-- 租赁信息部分 -->
        <div class="form-section">
            <h3>租赁信息</h3>
            <div class="form-row">
                <div class="form-group">
                    <label for="daily_rate">日租金(元) <span class="required">*</span></label>
                    <input type="number" id="daily_rate" name="daily_rate" min="0" step="0.01" placeholder="请输入日租金" required>
                </div>
                <div class="form-group">
                    <label for="available_start">可用开始时间 <span class="required">*</span></label>
                    <input type="datetime-local" id="available_start" name="available_start" required>
                </div>
            </div>
            
            <div class="form-row">
                <div class="form-group">
                    <label for="available_end">可用结束时间 <span class="required">*</span></label>
                    <input type="datetime-local" id="available_end" name="available_end" required>
                </div>
                <div class="form-group">
                    <label for="next_maintenance">下次保养时间</label>
                    <input type="datetime-local" id="next_maintenance" name="next_maintenance">
                </div>
            </div>
        </div>
        
        <!-- 其他信息部分 -->
        <div class="form-section">
            <h3>其他信息</h3>
            <div class="form-row">
                <div class="form-group full-width">
                    <label for="insurance_info">保险情况</label>
                    <textarea id="insurance_info" name="insurance_info" rows="4" placeholder="请描述车辆的保险情况，如交强险、商业险等"></textarea>
                </div>
            </div>
        </div>
        
        <!-- 表单按钮 -->
        <div class="form-actions">
            <button type="button" class="cancel-btn" onclick="window.location.href='./lender-dashboard.html'">取消</button>
            <button type="submit" class="submit-btn">提交</button>
        </div>
    
    </form>
</div>
    
<div class="footer">
    © 2023 快车租车 版权所有 | 联系方式：400-123-4567
</div>

<!-- 引入添加车辆相关的脚本 -->
<script src="../js/add-vehicle.js"></script>

</body>
</html>